#pragma once
#include "Win.h"
#include "InputHandler.h"
#include "Entity.h"
#include <windows.h>
#include "tiles.h"
#include "RenderHelper.h"
#include "Animation.h"
#include <cmath>
#include "SoundPlayer.h"

using namespace std;

class CPlayer : CEntity
{
private:
	int width;
	int height;
	
	RECT rect;
	HDC bufDC;
	HBITMAP bufBMP;
	HANDLE hImage;
	
	double angle;
	double throttle;

	double xSpeed;
	double ySpeed;
	double xAccel;
	double yAccel;

	Animation* a;

	//jetflame
	HANDLE hFlame;
	int fwidth;
	int fheight;
	double jetpackAngle;
	int resumeTime;

public:
	void Init(HDC);
	CPlayer(void);
	~CPlayer(void);

	virtual void Update();

	virtual void Draw(HDC);
	InputHandler* input;
	void setInput(InputHandler*);
	void IncreaseAngle(double);
	void IncreaseThrottle(double);
	string getDeaths();
	string getScore();
	string getHealth();
	Tiles* tiles;
	HANDLE* jetpack;
	HANDLE* brocko;
	double x;
	double y;
	int deaths;
	int score;
	int health;

	void die();

	int checkpoint;
	int spawnX;
	int spawnY;
	void setXSpeed(double x);
	void setYSpeed(double y);
	void setDeaths(int deaths);
	void setScore(int score);
	void addScore(int score);
	
	int waldoTime;
	bool isFlipped;

};
